//
//  SignInViewController.m
//  Marketing
//
//  Created by User on 16/5/12.
//  Copyright © 2016年 Hanen 3G 01. All rights reserved.
//

#import "SignInViewController.h"

@interface SignInViewController ()

@end
UILabel *timeData;
@implementation SignInViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = graySectionColor;
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationItem.titleView = [ViewTool getNavigitionTitleLabel:@"签到"];
    self.navigationItem.leftBarButtonItem=[ViewTool getBarButtonItemWithTarget:self WithAction:@selector(goToBack)];
    [self addView];
    
}

- (void)addView
{
    UIView *UpBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 20 + 64, KSCreenW, 80)];
    UpBgView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:UpBgView];
    
    UIView *DownBgView = [[UIView alloc] initWithFrame:CGRectMake(0, UpBgView.maxY + 20 , KSCreenW, 80)];
    DownBgView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:DownBgView];
    
    UILabel *addressLab = [[UILabel alloc] initWithFrame:CGRectMake(LEFTWIDTH, 10 , 80, 20)];
    addressLab.text = @"签到地点";
    [ViewTool setLableFont14:addressLab];
    [UpBgView addSubview:addressLab];
    
    UILabel *timeLab = [[UILabel alloc] initWithFrame:CGRectMake(LEFTWIDTH, addressLab.maxY + 20 , 80, 20)];
    timeLab.text = @"签到时间";
    [ViewTool setLableFont14:timeLab];
    [UpBgView addSubview:timeLab];
    
    timeData = [[UILabel alloc] initWithFrame:CGRectMake(timeLab.maxX +10, timeLab.y , 200, 20)];
    [ViewTool setLableFont14:timeData];
    timeData.textAlignment = NSTextAlignmentLeft;
    timeData.text = @"18:14";
    [UpBgView addSubview:timeData];
    
    UIButton *SelectButt = [[UIButton alloc] initWithFrame:CGRectMake(addressLab.maxX+10, addressLab.y , KSCreenW-addressLab.maxX-10, addressLab.height)];
    [SelectButt setTitle:@"请选择签到地点" forState:UIControlStateNormal];
    SelectButt.titleLabel.textColor = grayLineColor;
    [ViewTool setLableFont14:SelectButt.titleLabel];
    SelectButt.titleLabel.textAlignment = NSTextAlignmentLeft;
    [UpBgView addSubview:SelectButt];
    
    UIButton *jiantouButt = [[UIButton alloc] initWithFrame:CGRectMake(KSCreenW - 20, addressLab.y , 20, 20)];
    [jiantouButt setImage:[UIImage imageNamed:@"HY_list_icon_arrow"] forState:UIControlStateNormal];
    [UpBgView addSubview:SelectButt];
    
    [self addLineOnFrame:CGRectMake(0, 0, KSCreenW, 1) addview:UpBgView];
    [self addLineOnFrame:CGRectMake(0, UpBgView.height - 1, KSCreenW, 1) addview:UpBgView];
    [self addLineOnFrame:CGRectMake(0, 0, KSCreenW, 1) addview:DownBgView];
    [self addLineOnFrame:CGRectMake(0, DownBgView.height - 1, KSCreenW, 1) addview:DownBgView];
    
}

- (void)addLineOnFrame:(CGRect)rect addview:(UIView *)view
{
    UILabel *lab = [[UILabel alloc] initWithFrame:rect];
    lab.backgroundColor = grayLineColor;
    
    [view addSubview:lab];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)goToBack{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    self.tabBarController.hidesBottomBarWhenPushed = NO;
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.tabBarController.hidesBottomBarWhenPushed = YES;
}

@end
